<!-- 
All rights Reserved, Designed By www.youyacao.com 
@Description:管理中心主页
@author:成都市一颗优雅草科技有限公司     
@version 松鼠聚合直播系统v2.0
注意：本前端源码遵循 MulanPSL-2.0开源协议（木兰宽松许可证）本内容仅限于个人参考，禁止用于其他的商业用途
需要商业用途或者定制开发等可访问songshu.youyacao.com   联系QQ:422108995 23625059584

 -->


<template>
    <div>
        <div style="padding-bottom: 60px;">
            <router-view :userinfo="userinfo"  @userinfoUpdate="updateUserInfo" />
        </div>
        <van-tabbar v-model="active">
            <van-tabbar-item icon="desktop-o" to="/">工作台</van-tabbar-item>
            <van-tabbar-item icon="user-o" to="/member">会员管理</van-tabbar-item>
            <van-tabbar-item icon="friends-o" to="/daili" v-if="userinfo.user_type=='admin'">代理管理</van-tabbar-item>
            <van-tabbar-item icon="video-o" v-if="userinfo.user_type=='admin'" to="/video">小视频</van-tabbar-item>
        </van-tabbar>
    </div>
</template>

<script>
    export default {
        name: "main",
        props:["userinfo"],
        data(){
            return {
                active:0
            }
        },
        created() {
            switch (this.$route.path) {
                case "/":
                    this.active = 0;
                    break;
                case "/member":
                    this.active = 1;
                    break;
                case "/daili":
                    this.active = 2;
                    break;
                case "/video":
                    this.active = 3;
                    break;
            }
        },
        methods:{
            updateUserInfo:function (data) {
                this.userinfo = data;
            }
        }
    }
</script>

<style scoped>

</style>